<template>
  <div class="page">
    <nav_bar title='使用指南' background='#fff' :back="true" @back="handlerGobackClick"></nav_bar>
    <div v-html="content"></div>
  </div>
</template>
<script>
  export default {
    name: "index",
    data(){
      return{
        content: '搜索是'
      }
    },
    onShow() {
      this.getUseGuide();
    },
    methods:{
      async getUseGuide(){
        let res=await this.$request.getData('/auth/getUseGuide',{});
        if (res.data.level == 'success'){
          let str = res.data.data.content;
          str = str.replace(/<img[^>]*>/gi, function (match, capture) {
            return match.replace(/style\s*?=\s*?([‘"])[\s\S]*?\1/ig, '')
          });
          str = str.replace(/\<img/gi, '<img style="max-width:100%;height:auto" ');
          this.content = str;
        }
      },
      handlerGobackClick(){
        wx.navigateBack({
          delta: 1
        })
      },
    }
  }
</script>
<style lang="scss" scoped>
  .page{
    padding: 15px;
    width: calc(100vw - 30px);
  }
</style>
